package creatType.Singleton;

public class Singleton3 {
    private Singleton3() {
        System.out.println("I am singleton3!");
    }

    private static class Singleton3Holder {
        public static Resource r = new Resource("Singleton3");
    }

    public static Resource getSingleton() {
        // 只要singleton3Holder加载,就实例化resource
        return Singleton3Holder.r;
    }
}
